package bomber.action;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import bomber.model.GameButton;
import bomber.view.GamePanel;


public class GameAction implements ActionListener {

	private String actionName;
	private GamePanel gamePanel;
	private GameButton gameButton;

	public GameAction(String actionName, GamePanel gamePanel, GameButton gameButton) {
		this.actionName = actionName;
		this.gamePanel = gamePanel;
		this.gameButton = gameButton;
	}

	public void actionPerformed(ActionEvent aEvent) {
		if (this.actionName.equals("bomb")) {
			this.gameButton.initCheck();
			this.gamePanel.viewAll();
			this.gamePanel.messageBox("Game Over!", 0);
		}
		if (this.actionName.equals("numb")) {
			this.gameButton.initCheck();
		}
		if (this.actionName.equals("zero")) {
			this.gameButton.initCheck();
		}
	}
}
